//package com.labi.designpattern.controller;
//
//
//import com.labi.designpattern.enums.OrderEvent;
//import com.labi.designpattern.enums.OrderState;
//import com.labi.designpattern.service.OrderService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.statemachine.state.State;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//@RestController
//public class OrderController网上教程坑逼写法 {
//
//    private final OrderService orderService;
//
//    @Autowired
//    public OrderController网上教程坑逼写法(OrderService orderService) {
//        this.orderService = orderService;
//    }
//
//    @GetMapping("/create-order")
//    public String createOrder() {
//        orderService.createOrder();
//        return "Order created";
//    }
//    @GetMapping("/check")
//    public String checkOrder() {
//        orderService.checkOrder();
//        return "Order paid";
//    }
//    @GetMapping("/pay-order")
//    public String payOrder() {
//        orderService.payOrder();
//        return "Order paid";
//    }
//
//
//    @GetMapping("/complete-order")
//    public String completeOrder() {
//        orderService.completeOrder();
//        return "Order completed";
//    }
//
//    @GetMapping("/order-status")
//    public String getOrderStatus() {
//        State<OrderState, OrderEvent> currentState = orderService.getCurrentState();
//        return "Current order status: " + currentState.getId();
//    }
//}
